﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.Master" AutoEventWireup="true" CodeBehind="frm_Estudiante.aspx.cs" Inherits="ED_Nivelacion.PresentacionWeb.Estudiante1" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .auto-style1 {
            width: 358px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <script>
         $(document).ready(function () {

             //$('#ContentPlaceHolder1_Cbm_Periodo').attr('onchange', "Consultar()");
             $('#ContentPlaceHolder1_cbm_Carreras').attr('onchange', "Consultar()");
             $('#ContentPlaceHolder1_cbmParalelo').attr('onchange', "cambiar()");
         });
         


         function cambiar()
         {

             var paralelo = $('#ContentPlaceHolder1_cbmParalelo').val();
            // alert(paralelo);
             $('#ContentPlaceHolder1_txtCambio').val(paralelo);
         }


         function Consultar() {

             $('#ContentPlaceHolder1_cbmParalelo').html("");
             <%ED_Nivelacion.Negocios.Periodo_C _obj = new ED_Nivelacion.Negocios.Periodo_C();%>
             var periodo = <%=_obj.ObtenerPeriodo().Last().idPeriodo%>;//$('#ContentPlaceHolder1_Cbm_Periodo').val();
             var carrera = $('#ContentPlaceHolder1_cbm_Carreras').val();
             $.ajax({
                 type: "POST",
                 url: "ajax.aspx/Obtener_Paralelo",
                 data: "{_idPeriodo:" + periodo + ",_idCarrera:" + carrera + "}",
                 dataType: "json",
                 contentType: "application/json; charset=utf-8",
                 success: function (response) {
                     var paralelo = (typeof response.d) == 'string' ? eval('(' + response.d + ')') : response.d;
                     //alert(contactos.length);
                     $('#ContentPlaceHolder1_cbmParalelo').append(
                                             '<option value="">Escoja una opcion</option>');
                     for (var i = 0; i < paralelo.length; i++) {
                         $('#ContentPlaceHolder1_cbmParalelo').append(
                                               '<option value="' + paralelo[i].idParalelo + '">' + paralelo[i].ParaleloNombre + '</option>'
                                             );
                     }
                 },
                 error: function (response) {

                     alert('ERROR ' + response.status + ' ' + response.statusText);
                 }

             });
         }
    </script>
    <form id="Form1" runat="server">
                <asp:Timer ID="Timer1" runat="server">
                                </asp:Timer>
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>


                <!-- /. ROW  -->
      <p style="text-align:right"><a  href="tesis/lista.xlsx" >Descargar Plantilla</a></p>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">

                        <div class="panel panel-default">
                            <div class="panel-heading">
                                Ingreso de Estudiantes</div> 
                            <div class="panel-body">
                                <div class="table-responsive">




                                    <table class="table table-striped table-bordered table-hover">
                                        <thead>
                                        </thead>
                                        <tbody>
                                            <%--<tr>
                                                <td class="auto-style1">Periodo Académico:</td>
                                                <td>
                                                    <asp:DropDownList ID="Cbm_Periodo" runat="server" ValidateRequestMode="Enabled" AppendDataBoundItems="true">
                                                        <asp:ListItem>Escoja una opción</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>--%>
                                            <tr>
                                                <td class="auto-style1">Carrera:</td>
                                                <td>
                                                    <asp:DropDownList ID="cbm_Carreras" runat="server" ValidateRequestMode="Enabled" AppendDataBoundItems="true">
                                                <asp:ListItem Value="" Selected="True">Escoja una opción</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="auto-style1">Paralelo:</td>
                                                <td>
                                                    <asp:DropDownList ID="cbmParalelo" runat="server" ValidateRequestMode="Enabled" AppendDataBoundItems="true">
                                                <asp:ListItem Value="" Selected="True">Escoja una opción</asp:ListItem>
                                                    </asp:DropDownList>
                                                    <asp:TextBox ID="txtCambio" runat="server" CssClass="hide"></asp:TextBox>
                                                </td>
                                            </tr>

                                        </tbody>
                                    </table>
                                </div>
                            </div>
                        </div>

                    </div>
                    
                </div>
              <div>  
                  <div class="form-group">
                                                    <%--<input type="file" id="exampleInputFile">--%>
                                                    <asp:FileUpload ID="FileUpload1" runat="server" CssClass="btn btn-green" />
                                                    <br />
                <asp:Button ID="btnUpload" runat="server" Text="Subir" OnClick="btnUpload_Click" CssClass="btn btn-primary active" />
                                                </div>
                  <br />
                  <div class="portlet portlet-default">
                      <div class="portlet-heading">
                          <div class="portlet-title">
                              <h4>Paralelos</h4>
                          </div>
                          <div class="portlet-widgets">
                        &nbsp;
                    </div>
                          <div class="clearfix">
                          </div>
                      </div>
                      <div class="portlet-body">
                          <div class="table-responsive">
                              <table class="table table-condensed">
                                  <thead>
                                      <tr>
                                          <th>#</th>
                                          <th class="auto-style4">Nombre</th>
                                          <th class="auto-style1">Apellido</th>
                                          <th class="auto-style5">Cedula</th>
                                      </tr>
                                  </thead>
                                  <tbody id="tablaParalelos" runat="server">
                                  </tbody>
                              </table>
                          </div>
                      </div>
                  </div>
                  <br />
            <asp:Button ID="Btn_Estudiante" runat="server" CssClass="btn btn-default btn" Text="Enviar" Width="221px" Height="40px" OnClick="Btn_Estudiante_Click" />
               </div>
                <!-- /. ROW  -->
                
            <!-- /. PAGE INNER  -->
        </form>
</asp:Content>
